/*
 * rosa_queues.h
 *
 * Created: 2014-12-03 13:46:45
 *  Author: eds04001
 */ 
#include <stdlib.h>

struct rosa_readyQueue; //don't use from client code
typedef struct rosa_readyQueue *readyqueue; //use this
#ifndef ROSA_QUEUES_H_
#define ROSA_QUEUES_H_
typedef struct tcb_record_t {
	struct tcb_record_t * nexttcb;
	char id[4];		//The task id/name
	void (*staddr) (void);	//Start address
	int *dataarea;			//The stack data area
	int datasize;			//The stack size
	int *saveusp;			//The current stack position
	int SAVER0;				//Temporary work register
	int SAVER1;				//Temporary work register
	int savesr;				//The current status register
	int retaddr;			//The return address
	int savereg[15];		//The CPU registers
	unsigned int priority;			//The Priority of the task
	unsigned int wakeUpTime;		//The time task wakes up
} tcb;
tcb *readyQueueHead;
tcb *waitingQueueHead;
int ROSA_addToReadyQueue(tcb *newTask);
int ROSA_moveToRunning();
int ROSA_addToWaitingQueue(tcb *newTask,unsigned int time);
int ROSA_removeFromWaitingQueue();
void ROSA_tcbCreate(tcb * tcbTask, char tcbName[4], void *tcbFunction, int * tcbStack, int tcbStackSize,int priority);

#endif /* ROSA_QUEUES_H_ */